#pragma once
#ifndef __LIBAPOGEE_H__
#define __LIBAPOGEE_H__

#ifndef LibApogee
#define APOGEE_USB_ONLY	0
#define APOGEE_ETH_ONLY 1

#define	Apn_CameraMode int
#define	Apn_CameraMode_Normal 0
#define	Apn_CameraMode_TDI 1
#define	Apn_CameraMode_Test 2
#define	Apn_CameraMode_ExternalTrigger 3
#define	Apn_CameraMode_ExternalShutter 4
#define	Apn_CameraMode_Kinetics 5

#define	Apn_Resolution int
#define	Apn_Resolution_SixteenBit 0
#define	Apn_Resolution_TwelveBit 1

#define Apn_Filter int
#define Apn_Filter_Unknown  0
#define Apn_Filter_FW50_9R  1
#define Apn_Filter_FW50_7S  2
#define Apn_Filter_AFW25_4R 3
#define Apn_Filter_AFW30_7R 4
#define Apn_Filter_AFW50_5R 5

#define Apn_FilterStatus int
#define Apn_FilterStatus_NotConnected 0
#define Apn_FilterStatus_Ready 1
#define Apn_FilterStatus_Active 2

#endif //LibApogee

#ifdef __cplusplus
extern "C" {
#endif

int ApnGlueOpen(unsigned int id);

void ApnGlueGetMaxValues (double *exptime, int *roiw, int *roih, int *osw,
    int *osh, int *binw, int *binh, int *shutter, double *mintemp);

void ApnGlueGetGeom(double *pixX, double *pixY);

int ApnGlueSetExpGeom (int roiw, int roih, int osw, int osh, int binw,
    int binh, int roix, int roiy, int *impixw, int *impixh, char whynot[]);

void ApnGlueExpAbort(void);

int ApnGlueStartExp (double *exptime, int shutter);

int ApnGlueExpDone(void);

int ApnGlueReadPixels (unsigned short *buf, int nbuf, char whynot[]);

void ApnGlueSetTemp (double C);

int ApnGlueGetTemp (double *Cp);

void ApnGlueSetFan (int speed);
int ApnGlueGetFan();

void ApnGlueGetName(char **sensor, char **camera);



void ApnGlueReset();
void ApnGlueClose();
void ApnGluePauseTimer(int flag);
int ApnGlueStopExposure();
int ApnGluePowerDown();
void ApnGluePowerResume();
int ApnGlueReadShutter();
void ApnGlueOpenShutter(int flag);
void ApnGlueDisablePostExpFlushing(int flag);
void ApnGluePreFlash(int flag);
void ApnGlueWriteCamMode(Apn_CameraMode CameraMode);
void ApnGlueSetDatabits(Apn_Resolution BitResolution);
int ApnGlueReadSetPoint(double *temp, int *stat);
double ApnGlueGetHotTemp();
unsigned short ApnGlueGetSpeed();
void ApnGlueSetSpeed(unsigned short Sp);

int ApnGlueWheelOpen(unsigned int id, Apn_Filter type);
void ApnGlueWheelClose();
int ApnGlueWheelGetStatus();
int ApnGlueWheelGetMaxPos();
int ApnGlueWheelSetPos(int pos);
int ApnGlueWheelGetPos();

#ifdef __cplusplus
}
#endif

#endif // __LIBAPOGEE_H__
